<?php

$target_dir = dirname(dirname(__FILE__)) . '\\logs';

$today_dir = $target_dir . '\\' . date('Ymd');
if(!is_dir($today_dir)){
	@mkdir($today_dir);
}

$file = $today_dir . '/' . date('H') . '.log';

$content = $_SERVER['REMOTE_ADDR'] . ' ' . date('Y-m-d H:i:s')  . PHP_EOL . print_r($_POST,true) . PHP_EOL . print_r($data,true) . PHP_EOL;

if(!file_exists($file)){
	file_put_contents($file,$content);
}
else{
	file_put_contents($file,$content,FILE_APPEND);
}